//
//  ComposeTextView.swift
//  JIMWeiBo
//
//  Created by 陈恒均 on 2018/2/14.
//  Copyright © 2018年 陈恒均. All rights reserved.
//

import UIKit

class ComposeTextView: UITextView {

    lazy var placeholderLabel : UILabel = UILabel()
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setupUI()
    }

}

extension ComposeTextView{
    private func setupUI(){
        addSubview(placeholderLabel)
        
        placeholderLabel.snp.makeConstraints { (make) in
            make.top.equalTo(8)
            make.left.equalTo(10)
        }
        
        placeholderLabel.textColor = UIColor.lightGray
        placeholderLabel.font = font
        placeholderLabel.text = "分享新鲜事..."
        
        textContainerInset = UIEdgeInsets(top: 6, left: 7, bottom: 0, right: 7)
    }
}
